local skel = fk.CreateSkill {
  name = "emo__bugan",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["emo__bugan"] = "不甘",
  [":emo__bugan"] = "锁定技，每当你受到伤害后，你获得至多两张“灵感”牌。",

  ["#emo__bugan-card"] = "不甘：选择你要获得的牌",

  ["$emo__bugan1"] = "不甘心……不甘心！",
  ["$emo__bugan2"] = "诶！？呜呜不可饶恕！",
  ["$emo__bugan3"] = "诶！死了！？我不信我不信！",
}

skel:addEffect(fk.Damaged, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(skel.name) and target == player and #player:getPile("lingganPile") > 0
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local cards = room:askToCards(player, {
      min_num = 1, max_num = 2, skill_name = skel.name, pattern = ".|.|.|lingganPile", cancelable = false, include_equip = false,
      expand_pile = "lingganPile", prompt = "#emo__bugan-card",
    })
    room:obtainCard(player, cards, true, fk.ReasonPrey, player, skel.name)
  end,
})

return skel
